package com.xgame.server.netty.enity;

import io.netty.channel.Channel;

public class MsgEntity {
    private int MsgID = 0;// 储存命令码
    private int TimeStamp = 0;
    private int Reserved = 0;  //保留长度
    private int MsgLength = 0; //存储包体长度
    private byte[] MsgBody;// 存放实际数据,用于protobuf解码成对应message
    private Channel channel;// 当前玩家的channel

    public int getCmdCode() {
        return MsgID;
    }

    public void setCmdCode(int cmdCode) {
        this.MsgID = cmdCode;
    }

    public int getTimeStamp() {
        return TimeStamp;
    }

    public void setTimeStamp(int TimeStamp) {
        this.TimeStamp = TimeStamp;
    }

    public int getReserved() {
        return Reserved;
    }

    public void setReserved(int Reserved) {
        this.Reserved = Reserved;
    }

    public int getMsgLength() {
        return MsgLength;
    }

    public void setMsgLength(int MsgLength) {
        this.MsgLength = MsgLength;
    }

    public byte[] getData() {
        return MsgBody;
    }

    public void setData(byte[] MsgBody) {
        this.MsgBody = MsgBody;
        setMsgLength(MsgBody.length);
    }

    public Channel getChannel() {
        return channel;
    }

    public void setChannel(Channel channel) {
        this.channel = channel;
    }
}
